import { ModuleTypes } from '@/store'


export enum ActionTypes {
    ACTION_TOGGLE_SIDEBAR = 'ACTION_TOGGLE_SIDEBAR',
    ACTION_CLOSE_SIDEBAR = 'ACTION_CLOSE_SIDEBAR',
    ACTION_TOGGLE_DEVICE = 'ACTION_TOGGLE_DEVICE',
    ACTION_SET_LANGUAGE = 'ACTION_SET_LANGUAGE',
    ACTION_SET_SIZE = 'ACTION_SET_SIZE',
}

const someKey = enumKeysAsString(ActionTypes);

export type ActionTypesNamespaced = `${ModuleTypes.appModule}/${typeof someKey}`



function enumKeysAsString<TEnum>(theEnum: TEnum): keyof TEnum {
    const keys = Object.keys(theEnum).filter(x =>
        (+x) + "" !== x) as (keyof TEnum)[];
    return keys[Math.floor(Math.random() * keys.length)];
}